package servlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ServletContextListenerTest implements ServletContextListener {

	@Override
	public void contextDestroyed(ServletContextEvent event) {
		
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
		ServletContext sc = event.getServletContext();
		String dogBreed  = sc.getInitParameter("breed");
		System.out.println("aaaaaaaaaaaaaa"+dogBreed);
		Dog dog = new Dog(dogBreed);
		event.getServletContext().setAttribute("dog", dog);
	}

}
